//
//  MCDYPopView.m
//  TLYL
//
//  Created by miaocai on 2017/9/27.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCDYPopView.h"
#import "MCGroupPaymentModel.h"
#import "MCRecordTool.h"

static MCDYPopView *_instance;
@interface MCDYPopView()

@property (nonatomic,weak) UILabel *dingDanNumberLabel;
@property (nonatomic,weak) UILabel *dingDanDetailLabel;
@property (nonatomic,weak) UILabel *jinELabel;
@property (nonatomic,weak) UILabel *jinEDetailLabel;
@property (nonatomic,weak) UILabel *dateLabel;
@property (nonatomic,weak) UILabel *dateDetailLabel;
@property (nonatomic,weak) UILabel *statusLabel;
@property (nonatomic,weak) UILabel *statusDetailLabel;
@property (nonatomic,weak) UILabel *jiaoyiStatusLabelDetail;
@property (nonatomic,weak) UILabel *jiaoyiStatusLabel;
@property (nonatomic,weak) UIButton *continueBtn;
@property (nonatomic,weak) UILabel *zhuanStatusDetailLabel;
@property (nonatomic,weak) UILabel *zhuanStatusLabel;
@property (nonatomic,weak) UILabel *infoLabel;
@property (nonatomic,weak) UILabel *infoDetailLabel;
@property (nonatomic,weak) UIView *middleView;
@property (nonatomic,weak) UIView *bgView;
@property (nonatomic,weak) UILabel *feeMoneyLabel;
@property (nonatomic,weak) UILabel *feeMoneyLabelValue;

@end
@implementation MCDYPopView
- (instancetype)init{
    if (self == [super init]) {
        self.hidden = YES;
        [self setUiUP];
    }
    
    return self;
}

- (void)setUiUP{
    self.frame = CGRectMake(0, 194 - kStatusBarAndNavigationBarHeight, G_SCREENWIDTH - MC_REALVALUE(40), MC_REALVALUE(260 + 17 + 50));
    self.backgroundColor = [UIColor clearColor];
    
    UIImageView *bgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, MC_REALVALUE(17), G_SCREENWIDTH - MC_REALVALUE(40), MC_REALVALUE(270 + 40))];
    UIImage *image = [UIImage imageNamed:@"touzhu-beijing"];
    self.bgView = bgView;
    // 设置端盖的值
    CGFloat top = image.size.height * 0.5;
    CGFloat left = image.size.width * 0.5;
    CGFloat bottom = image.size.height * 0.5;
    CGFloat right = image.size.width * 0.5;
    UIEdgeInsets edgeInsets = UIEdgeInsetsMake(top, left, bottom, right);
    // 拉伸图片
    UIImage *newImage = [image resizableImageWithCapInsets:edgeInsets];
    bgView.image = newImage;
    [self addSubview:bgView];
    //    bgView.backgroundColor = [UIColor whiteColor];
    bgView.layer.cornerRadius = 6;
    bgView.clipsToBounds = YES;
    bgView.userInteractionEnabled = YES;
    
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake((self.widht - MC_REALVALUE(180))*0.5, 0, MC_REALVALUE(180), MC_REALVALUE(34))];
    label.backgroundColor = MC_THEME_COLOR;
    label.text = @"资金明细";
    label.font = [UIFont systemFontOfSize:MC_REALVALUE(14)];
    label.textColor = [UIColor whiteColor];
    label.textAlignment = NSTextAlignmentCenter;
    label.layer.cornerRadius = MC_REALVALUE(17);
    label.clipsToBounds = YES;
    [self addSubview:label];
    
    UIView *middleView = [[UIView alloc] init];
    [bgView addSubview:middleView];
    middleView.backgroundColor = RGB(251, 251, 251);
    middleView.layer.borderWidth = 0.5;
    middleView.layer.borderColor = RGB(220, 220, 200).CGColor;
    [middleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(MC_REALVALUE(20));
        make.right.equalTo(self).offset(MC_REALVALUE(-20));
        make.top.equalTo(self).offset(MC_REALVALUE(44));
        make.height.equalTo(@(MC_REALVALUE(220)));
    }];
    self.middleView = middleView;
    
    UIButton *continueBtn = [[UIButton alloc] init];
    [bgView addSubview:continueBtn];
    continueBtn.backgroundColor = MC_THEME_COLOR;
    [continueBtn setTitle:@"继续充值" forState:UIControlStateNormal];
    [continueBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    continueBtn.titleLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    continueBtn.layer.cornerRadius = 4;
    continueBtn.clipsToBounds = YES;
    [continueBtn addTarget:self action:@selector(continueBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [continueBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(MC_REALVALUE(25));
        make.height.equalTo(@(MC_REALVALUE(34)));
        make.top.equalTo(middleView.mas_bottom).offset(MC_REALVALUE(8));
        make.width.equalTo(@((self.widht - MC_REALVALUE(60))*0.5));
    }];
    self.continueBtn = continueBtn;
    UIButton *cancelBtn = [[UIButton alloc] init];
    [bgView addSubview:cancelBtn];
    cancelBtn.layer.cornerRadius = 4;
    cancelBtn.clipsToBounds = YES;
    cancelBtn.backgroundColor = RGB(255, 168, 0);
    [cancelBtn setTitle:@"取消返回" forState:UIControlStateNormal];
    [cancelBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    cancelBtn.titleLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    [cancelBtn addTarget:self action:@selector(cancelBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(continueBtn.mas_right).offset(MC_REALVALUE(10));
        make.height.equalTo(@(MC_REALVALUE(34)));
        make.top.equalTo(middleView.mas_bottom).offset(MC_REALVALUE(8));
        make.width.equalTo(@((self.widht - MC_REALVALUE(60))*0.5));
    }];
    
    UILabel *dingDanLabel = [[UILabel alloc] init];
    [middleView addSubview:dingDanLabel];
    self.dingDanNumberLabel = dingDanLabel;
    dingDanLabel.text = @"订单编号：";
    dingDanLabel.textColor = RGB(46, 46, 46);
    dingDanLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    
    UILabel *dingDanDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:dingDanDetailLabel];
    dingDanDetailLabel.textColor = RGB(46, 46, 46);
    dingDanDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.dingDanDetailLabel = dingDanDetailLabel;
    dingDanDetailLabel.numberOfLines=0;
    
    UILabel *jiaoyiStatusLabel = [[UILabel alloc] init];
    [middleView addSubview:jiaoyiStatusLabel];
    self.jiaoyiStatusLabel = jiaoyiStatusLabel;
    jiaoyiStatusLabel.text = @"充值方式：";
    jiaoyiStatusLabel.textColor = RGB(46, 46, 46);
    jiaoyiStatusLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];

    UILabel *statusLabelDetail = [[UILabel alloc] init];
    [middleView addSubview:statusLabelDetail];
    self.middleView = middleView;
    statusLabelDetail.textColor = RGB(46, 46, 46);
    statusLabelDetail.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.jiaoyiStatusLabelDetail = statusLabelDetail;
    
    
    UILabel *jinELabel = [[UILabel alloc] init];
    [middleView addSubview:jinELabel];
    jinELabel.text = @"交易金额：";
    jinELabel.textColor = RGB(46, 46, 46);
    jinELabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.jinELabel = jinELabel;
    
    
    
    UILabel *jinEDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:jinEDetailLabel];
    jinEDetailLabel.textColor = RGB(249, 84, 83);
    jinEDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.jinEDetailLabel = jinEDetailLabel;
    
    UILabel *feeMoneyLabel = [[UILabel alloc] init];
    [middleView addSubview:feeMoneyLabel];
    feeMoneyLabel.textColor = RGB(46, 46, 46);
    feeMoneyLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    feeMoneyLabel.text = @"手续费：";
    self.feeMoneyLabel = feeMoneyLabel;
    
    UILabel *feeMoneyLabelValue = [[UILabel alloc] init];
    [middleView addSubview:feeMoneyLabelValue];
    feeMoneyLabelValue.textColor = RGB(46, 46, 46);
    feeMoneyLabelValue.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.feeMoneyLabelValue = feeMoneyLabelValue;
     feeMoneyLabelValue.text = @"-";
    
    UILabel *zhuanStatusLabel = [[UILabel alloc] init];
    [middleView addSubview:zhuanStatusLabel];
    zhuanStatusLabel.textColor = RGB(46, 46, 46);
    zhuanStatusLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    zhuanStatusLabel.text = @"转账状态：";
    self.zhuanStatusLabel = zhuanStatusLabel;
    
    UILabel *zhuanStatusDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:zhuanStatusDetailLabel];
    zhuanStatusDetailLabel.textColor = RGB(46, 46, 46);
    zhuanStatusDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.zhuanStatusDetailLabel = zhuanStatusDetailLabel;
    
    UILabel *dateLabel = [[UILabel alloc] init];
    [middleView addSubview:dateLabel];
    dateLabel.textColor = RGB(46, 46, 46);
    dateLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    dateLabel.text = @"账变时间：";
    self.dateLabel = dateLabel;
    
    UILabel *dateDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:dateDetailLabel];
    dateDetailLabel.textColor = RGB(46, 46, 46);
    dateDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.dateDetailLabel = dateDetailLabel;
    
    
    UILabel *statusLabel = [[UILabel alloc] init];
    [middleView addSubview:statusLabel];
    statusLabel.textColor = RGB(46, 46, 46);
    statusLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    statusLabel.text = @"充值状态：";
    self.statusLabel = statusLabel;
    
    UILabel *statusDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:statusDetailLabel];
    statusDetailLabel.textColor = RGB(46, 46, 46);
    statusDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.statusDetailLabel = statusDetailLabel;
    
    
    UILabel *infoLabel = [[UILabel alloc] init];
    [middleView addSubview:infoLabel];
    infoLabel.textColor = RGB(46, 46, 46);
    infoLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    infoLabel.text = @"备注信息：";
    self.infoLabel = infoLabel;
    
    UILabel *infoDetailLabel = [[UILabel alloc] init];
    [middleView addSubview:infoDetailLabel];
    infoDetailLabel.textColor = RGB(46, 46, 46);
    infoDetailLabel.font = [UIFont systemFontOfSize:MC_REALVALUE(12)];
    self.infoDetailLabel = infoDetailLabel;

    [self.dingDanNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.middleView).offset(MC_REALVALUE(10));
        make.left.equalTo(self.middleView).offset(MC_REALVALUE(10));
        
    }];
    [self.dingDanDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel.mas_right);
        make.right.equalTo(self.mas_right).offset(-25);
        make.top.equalTo(self.dingDanNumberLabel);
    }];
    [self.jiaoyiStatusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.dingDanDetailLabel.mas_bottom).offset(MC_REALVALUE(10));
        make.left.equalTo(self.dingDanNumberLabel);

    }];
    [self.jiaoyiStatusLabelDetail mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jiaoyiStatusLabel.mas_right);
        make.top.equalTo(self.jiaoyiStatusLabel);
    }];
    
    
    [self.jinELabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jiaoyiStatusLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.jinEDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jinELabel.mas_right);
        make.top.equalTo(self.jinELabel);
    }];
    
    
    [self.feeMoneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jinELabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.feeMoneyLabelValue mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.feeMoneyLabel.mas_right);
        make.top.equalTo(self.feeMoneyLabel);
    }];
    
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.feeMoneyLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.dateDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dateLabel.mas_right);
        make.top.equalTo(self.dateLabel);
    }];
    
    
    
    [self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.dateLabel.mas_bottom).offset(MC_REALVALUE(10));

    }];
    self.statusDetailLabel.numberOfLines = 2;
    [self.statusDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.statusLabel.mas_right);
        make.top.equalTo(self.statusLabel);
    }];
    
    
    [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.dateLabel);
        make.top.equalTo(self.statusLabel.mas_bottom).offset(MC_REALVALUE(10));
    }];
    
    [self.infoDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.infoLabel.mas_right);
        make.top.equalTo(self.infoLabel);
        make.right.equalTo(self.middleView.mas_right);

    }];
    self.infoDetailLabel.numberOfLines = 2;
}

- (void)continueBtnClick{
    
    if (self.continueBtnBlock) {
        self.continueBtnBlock();
    }
}
- (void)cancelBtnClick{
    if (self.cancelBtnBlock) {
        self.cancelBtnBlock();
    }
}
- (void)show{
 self.hidden = NO;
 self.transform = CGAffineTransformMakeScale(0.05, 0.05);
 [UIView animateWithDuration:0.1 animations:^{
    self.transform = CGAffineTransformMakeScale(1, 1);
 }];
}
- (void)hidden{
    [UIView animateWithDuration:0.1 animations:^{
        self.transform = CGAffineTransformMakeScale(0.0001, 0.0001);
    } completion:^(BOOL finished) {
         self.hidden = YES;
    }];
}
#pragma mark -- 充值
- (void)setDataSource:(MCTopUpRecordModel *)dataSource{

    self.jiaoyiStatusLabel.hidden = NO;
    self.jiaoyiStatusLabelDetail.hidden = NO;
    _dataSource = dataSource;
    self.infoLabel.hidden = NO;
    self.infoDetailLabel.hidden = NO;
    int re = [dataSource.RechargeType intValue];
    if (re !=2 &&re !=3 &&re !=4 && [dataSource.RechargeMark isEqualToString:@""]) {
         self.infoDetailLabel.text = @"用户充值";//dataSource.
    } else {
        self.infoDetailLabel.text = dataSource.RechargeMark;
    }

    self.zhuanStatusLabel.hidden = YES;
    self.zhuanStatusDetailLabel.hidden = YES;
    self.statusLabel.text = @"充值状态：";
    [self.dingDanNumberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.middleView).offset(MC_REALVALUE(10));
        make.left.equalTo(self.middleView).offset(MC_REALVALUE(10));
        
    }];
    [self.dingDanDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel.mas_right);
        make.top.equalTo(self.dingDanNumberLabel);
    }];
    [self.jiaoyiStatusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.dingDanDetailLabel.mas_bottom).offset(MC_REALVALUE(10));
        make.left.equalTo(self.dingDanNumberLabel);

    }];
    [self.jiaoyiStatusLabelDetail mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jiaoyiStatusLabel.mas_right);
        make.top.equalTo(self.jiaoyiStatusLabel);
    }];
    
    
    [self.jinELabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jiaoyiStatusLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.jinEDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jinELabel.mas_right);
        make.top.equalTo(self.jinELabel);
    }];
    [self.feeMoneyLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jinELabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.feeMoneyLabelValue mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.feeMoneyLabel.mas_right);
        make.top.equalTo(self.feeMoneyLabel);
    }];
    
    [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.feeMoneyLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.dateDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dateLabel.mas_right);
        make.top.equalTo(self.dateLabel);
    }];
    
    

    [self.statusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.dateLabel.mas_bottom).offset(MC_REALVALUE(10));

    }];
    [self.statusDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.statusLabel.mas_right);
        make.top.equalTo(self.statusLabel);
    }];

    [self.continueBtn setTitle:@"继续充值" forState:UIControlStateNormal];
//    self.jiaoyiStatusLabel.text = @"充值状态：";
     self.dingDanDetailLabel.text = dataSource.RechargeOrder;
    self.jinEDetailLabel.text = GetRealSNum(self.dataSource.RechargeMoney);
    self.dateDetailLabel.text = dataSource.CreateTime;
    
    //状态
    if ([self.dataSource.RechargeState isEqualToString:@"0"]) {
        self.statusDetailLabel.text = @"未处理";
        self.statusDetailLabel.textColor = MC_THEME_COLOR;
    } else if ([self.dataSource.RechargeState isEqualToString:@"1"]){
        self.statusDetailLabel.text = @"交易成功";
        self.statusDetailLabel.textColor = RGB(30, 212, 17);
    }else if ([self.dataSource.RechargeState isEqualToString:@"2"]){
        self.statusDetailLabel.text = @"交易失败";
        self.statusDetailLabel.textColor = RGB(249, 84, 83);
    }else{
//        self.statusDetailLabel.text = @"未处理";
//        self.statusDetailLabel.textColor = MC_THEME_COLOR;
    }

    self.jiaoyiStatusLabel.text = @"充值方式：";
    self.jiaoyiStatusLabelDetail.text = dataSource.PayTypeName;
    self.feeMoneyLabelValue.text = GetRealSNum(dataSource.FeeMoney);
}
#pragma mark -- 提款
- (void)setDataSourceD:(MCWithdrawModel *)dataSourceD{
    self.jiaoyiStatusLabel.hidden = YES;
    self.jiaoyiStatusLabelDetail.hidden = YES;
//    self.statusLabel.hidden = YES;
//    self.statusDetailLabel.hidden = YES;
    self.jiaoyiStatusLabel.text = @"提款方式:";
    _dataSourceD = dataSourceD;
    self.infoLabel.hidden = NO;
    self.infoDetailLabel.hidden = NO;

    self.zhuanStatusLabel.hidden = YES;
    self.zhuanStatusDetailLabel.hidden = YES;
    [self.dingDanNumberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.middleView).offset(MC_REALVALUE(20));
        make.left.equalTo(self.middleView).offset(MC_REALVALUE(10));
        
    }];
    [self.dingDanDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel.mas_right);
        make.top.equalTo(self.dingDanNumberLabel);
    }];
//    [self.jiaoyiStatusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.dingDanNumberLabel.mas_bottom).offset(MC_REALVALUE(10));
//        make.left.equalTo(self.dingDanNumberLabel);
//
//    }];
//    [self.jiaoyiStatusLabelDetail mas_remakeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.jiaoyiStatusLabel.mas_right);
//        make.top.equalTo(self.jiaoyiStatusLabel);
//    }];
    
    
    [self.jinELabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.dingDanDetailLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.jinEDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jinELabel.mas_right);
        make.top.equalTo(self.jinELabel);
    }];
    
    [self.feeMoneyLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jinELabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.feeMoneyLabelValue mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.feeMoneyLabel.mas_right);
        make.top.equalTo(self.feeMoneyLabel);
    }];
    
    [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.feeMoneyLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.dateDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dateLabel.mas_right);
        make.top.equalTo(self.dateLabel);
    }];
    
    
    
    [self.statusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.dateLabel.mas_bottom).offset(MC_REALVALUE(10));

    }];
    [self.statusDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.statusLabel.mas_right);
        make.top.equalTo(self.statusLabel);
    }];
   
    [self.continueBtn setTitle:@"继续提款" forState:UIControlStateNormal];
    self.jinEDetailLabel.text = GetRealSNum(dataSourceD.DrawingsMoney);
        self.dateDetailLabel.text = dataSourceD.CreateTime;
    int re = [dataSourceD.DrawingsType intValue];
    if (re ==0 ||re ==1 ) {
        self.infoDetailLabel.text = @"用户提款";
    } else {
        self.infoDetailLabel.text = dataSourceD.DrawingsMark;
    }
   
//        //状态
        if ([dataSourceD.DrawingsState isEqualToString:@"0"]) {
            self.statusDetailLabel.text = @"未处理";
            self.statusDetailLabel.textColor = MC_THEME_COLOR;
        } else if ([dataSourceD.DrawingsState isEqualToString:@"1"]){
            self.statusDetailLabel.text = @"交易中";
            self.statusDetailLabel.textColor = RGB(30, 212, 17);
        }else if ([dataSourceD.DrawingsState isEqualToString:@"2"]){
            self.statusDetailLabel.text = @"拒绝";
            self.statusDetailLabel.textColor = RGB(249, 84, 83);
             self.infoDetailLabel.text = dataSourceD.DrawingsMark;
        }else if ([dataSourceD.DrawingsState isEqualToString:@"3"]){
            self.statusDetailLabel.text = @"交易成功";
            self.statusDetailLabel.textColor = RGB(249, 84, 83);
        }else if ([dataSourceD.DrawingsState isEqualToString:@"4"]){
            self.statusDetailLabel.text = @"交易失败";
            self.statusDetailLabel.textColor = RGB(249, 84, 83);
        }else{
            self.statusDetailLabel.text = @"--";
            self.statusDetailLabel.textColor = RGB(249, 84, 83);
        }
    self.dingDanDetailLabel.text = dataSourceD.DrawingsOrder;
        int RechargeType =  [dataSourceD.DrawingsType intValue];
        if (RechargeType == 0) {
            self.jiaoyiStatusLabelDetail.text = @"自动出款";
        } else if(RechargeType == 1) {
            self.jiaoyiStatusLabelDetail.text = @"提款";
        }else if(RechargeType == 2){
            self.jiaoyiStatusLabelDetail.text = @"人工提款";
        }else if(RechargeType == 7){
            self.jiaoyiStatusLabelDetail.text = @"其他扣款";
        }else if(RechargeType == 8){
            self.jiaoyiStatusLabelDetail.text = @"活动扣款";
        }else{
            self.jiaoyiStatusLabelDetail.text = @"—-";
        }
    self.statusLabel.text = @"提款状态：";
    self.feeMoneyLabelValue.text = GetRealSNum(dataSourceD.FeeMoney);;
}
#pragma mark -- 转账
- (void)setDataSourceZ:(MCZhuanRecordModel *)dataSourceZ{
    self.statusLabel.hidden = NO;
    self.statusDetailLabel.hidden = NO;
    _dataSourceZ = dataSourceZ;
    self.infoLabel.hidden = YES;
    self.infoDetailLabel.hidden = YES;
    self.zhuanStatusLabel.hidden = NO;
    self.zhuanStatusDetailLabel.hidden = NO;
     self.statusDetailLabel.textColor = RGB(46, 46, 46);
    [self.dingDanNumberLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.middleView).offset(MC_REALVALUE(14));
        make.left.equalTo(self.middleView).offset(MC_REALVALUE(10));
        make.width.equalTo(@(MC_REALVALUE(68)));
        
    }];
    
    [self.jiaoyiStatusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.dingDanDetailLabel.mas_bottom).offset(MC_REALVALUE(10));
        make.left.equalTo(self.dingDanNumberLabel);
        
    }];
    [self.jiaoyiStatusLabelDetail mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jiaoyiStatusLabel.mas_right);
        make.top.equalTo(self.jiaoyiStatusLabel);
    }];
    [self.jinELabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jiaoyiStatusLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.jinEDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.jinELabel.mas_right);
        make.top.equalTo(self.jinELabel);
    }];
  
    [self.feeMoneyLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.jinELabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.feeMoneyLabelValue mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.feeMoneyLabel.mas_right);
        make.top.equalTo(self.feeMoneyLabel);
    }];
    
    [self.zhuanStatusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.feeMoneyLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.zhuanStatusDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.zhuanStatusLabel.mas_right);
        make.top.equalTo(self.zhuanStatusLabel);
    }];
    
   
    [self.dateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.zhuanStatusLabel.mas_bottom).offset(MC_REALVALUE(10));
        
        
    }];
    [self.dateDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dateLabel.mas_right);
        make.top.equalTo(self.dateLabel);
    }];
    
    [self.statusLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dingDanNumberLabel);
        make.top.equalTo(self.dateLabel.mas_bottom).offset(MC_REALVALUE(10));
        
    }];
    
    [self.statusDetailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.statusLabel.mas_right);
        make.top.equalTo(self.statusLabel);
        make.width.equalTo(@(MC_REALVALUE(260 - 40)));
    }];
    
    self.dingDanDetailLabel.text = dataSourceZ.OrderId;
    self.statusLabel.text = @"备注信息:";
     [self.continueBtn setTitle:@"继续转账" forState:UIControlStateNormal];
     self.jiaoyiStatusLabel.text = @"资金去向：";
    NSString *jiaoyiS = @"";
    if ([dataSourceZ.DetailsSource isEqualToString:@"290"]|| [dataSourceZ.DetailsSource isEqualToString:@"490"]){
        jiaoyiS = @"彩票-->棋牌";
    }else if ([dataSourceZ.DetailsSource isEqualToString:@"300"]||[dataSourceZ.DetailsSource isEqualToString:@"310"]||[dataSourceZ.DetailsSource isEqualToString:@"500"]){
        jiaoyiS =@"棋牌-->彩票";
        // menhao test
    }else if ([dataSourceZ.DetailsSource isEqualToString:@"390"]){
        jiaoyiS = @"彩票-->VR";
    }else if ([dataSourceZ.DetailsSource isEqualToString:@"400"]){
        jiaoyiS =@"VR-->彩票";
    }else if ([dataSourceZ.DetailsSource isEqualToString:@"590"]){
        jiaoyiS =@"彩票-->AG";
    }else if ([dataSourceZ.DetailsSource isEqualToString:@"600"]){
        jiaoyiS =@"AG-->彩票";
    }else {
        jiaoyiS = @"转账失败退款";
    }

    self.jiaoyiStatusLabelDetail.text = jiaoyiS;
    NSString *TransferMoney = [NSString stringWithFormat:@"%@",dataSourceZ.TransferMoney];
    self.jinEDetailLabel.text = GetRealSNum(TransferMoney);
    self.dateDetailLabel.text = dataSourceZ.InsertTime;
    //状态
    if ([dataSourceZ.TransferType isEqualToString:@"3"]) {
        self.zhuanStatusDetailLabel.text = @"未处理";
        self.zhuanStatusDetailLabel.textColor = MC_THEME_COLOR;
    } else if ([dataSourceZ.TransferType isEqualToString:@"2"]){
        self.zhuanStatusDetailLabel.text = @"交易成功";
        self.zhuanStatusDetailLabel.textColor = RGB(30, 212, 17);
    }else if ([dataSourceZ.TransferType isEqualToString:@"4"]){
        self.zhuanStatusDetailLabel.text = @"交易失败";
        self.zhuanStatusDetailLabel.textColor = RGB(249, 84, 83);
    }
    self.statusDetailLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    self.statusDetailLabel.text = dataSourceZ.Marks;
    if (dataSourceZ.FeeMoney == nil ||[dataSourceZ.FeeMoney isEqualToString:@""]) {
        self.feeMoneyLabelValue.text = @"-";
    } else {
        self.feeMoneyLabelValue.text = GetRealSNum(dataSourceZ.FeeMoney);
    }
    
  

}
@end
